"""
编写类Book,定义方法update_price,实现更改某本书的价格,具体:如果价格>150,就更改为150，如果价格>100
就更改为100，否则不变
"""
class Book:
    name = None
    price = None

    def __init__(self , name ,price):
        self.name = name
        self.price = price
    def update_price(self):
        if self.price > 150:
            self.price = 150
        elif self.price > 100:
            self.price = 100

    def book_info(self):
        print(f"书本的信息:名字{self.name}，价格:{self.price}")

book = Book("三国演义" , 160)
book.book_info()
book.update_price()
book.book_info()